from rest_framework import serializers

# from common.models import TbOrganizetionFiles, TbRealnameCertification, TbDiscussionGroup, TbMiniappUser, TbImMessage, \
#     TbImChatgroup, TbCourseTaskRemain, TbDispute, TbTeacherEvaluate, TbKnowledgepoints, TbDisputeFiles, TbInvite, \
#     TbInviteRecord

from common.models import *


class LeaderboardSerializer(serializers.ModelSerializer):
    """
    排行榜
    """

    class Meta:
        model = TbLeaderboard
        depth = 1
        fields = "__all__"


class SportsRecordSerializer(serializers.ModelSerializer):
    """
    运动记录
    """

    class Meta:
        model = TbSportsRecord
        depth = 1
        fields = "__all__"


class LikeRecordSerializer(serializers.ModelSerializer):
    """
    点赞记录
    """

    class Meta:
        model = TbLikeRecord
        depth = 1
        fields = "__all__"


class GamesSerializer(serializers.ModelSerializer):
    """
    赛事
    """

    class Meta:
        model = TbGames
        depth = 1
        fields = "__all__"


class GamePicSerializer(serializers.ModelSerializer):
    """
    赛事图片
    """
    game_id = serializers.CharField(write_only=True, required=False)

    class Meta:
        model = TbGamesPic
        depth = 1
        fields = "__all__"


class GameApplySerilizer(serializers.ModelSerializer):
    """
    赛事报名
    """
    game_id = serializers.CharField(write_only=True, required=False)

    class Meta:
        model = TbGameApply
        depth = 1
        fields = "__all__"


class OrderSerilizer(serializers.ModelSerializer):
    """
    订单
    """

    class Meta:
        model = TbOrders
        depth = 1
        fields = "__all__"


class ChatgroupSerilizer(serializers.ModelSerializer):
    """
    聊天组
    """

    class Meta:
        model = ImChatgroup
        depth = 1
        fields = "__all__"


class MessageSerilizer(serializers.ModelSerializer):
    """
    消息记录
    """
    group_id = serializers.CharField(write_only=True, required=True)

    class Meta:
        model = ImMessage
        depth = 1
        fields = "__all__"


class UserSerializer(serializers.ModelSerializer):
    """
    用户表
    """

    class Meta:
        model = TbMiniappUser
        depth = 1
        fields = "__all__"


class SiteSerializer(serializers.ModelSerializer):
    """
    场地
    """

    class Meta:
        model = TbSite
        depth = 1
        fields = "__all__"


class SiteApplySerializer(serializers.ModelSerializer):
    """
    场地申请
    """
    site_id = serializers.CharField(write_only=True, required=False)

    class Meta:
        model = TbSiteApply
        depth = 1
        fields = "__all__"
